define(function(require, exports, module) {
	"use strict";
	require("../../dep/mui/js/mui.min.js");
	require("jquery");
	require("../common.js");
	//引入关闭tabjs
	var chioceTab = require("chioceTab");
	//调用日期筛选传值
	require("getSearchDateItem");
	//首页客户列表返回
	var commonBack = require("commonBack");
	mui("body").on("tap", ".client-list-back", function() {
		commonBack.secondBack();
	});
	//钉钉返回
	require('http://g.alicdn.com/ilw/ding/0.8.9/scripts/dingtalk.js');
	var dingTalkNav = require('dd_config');
	dingTalkNav.LeftNavBar(commonBack.secondBack);
	//ad
	dingTalkNav.leftAndroid(commonBack.secondBack);
	dingTalkNav.RightNavBar(false, "更多", "default");
	var typeid = 1;
	var startDate = ''; //开始时间
	var endDate = ''; //结束时间
	var abpdata = require("abpinit");
	var abp = abpdata.abpstart;
	var option = {};
	var bageoption = function() {
		$(".bage").css("display", "none");
		var option = {};
		var dataModel = {
			"beginTime": startDate,
			"endTime": endDate
		};

		abp.services.app.auditList.auditTypeCount(dataModel, option).done(function(data) {

			$.each(data, function(index, item) {
				if(abp.sourceType.BUY == item.aduitType && item.acount > 0) {
					$(".bage-cgd").html(item.acount);
					$(".bage-cgd").css("display", "block");
				} else if(abp.sourceType.SELL == item.aduitType && item.acount > 0) {
					$(".bage-xsd").html(item.acount);
					$(".bage-xsd").css("display", "block");
				} else if(abp.sourceType.BUY_INPUT == item.aduitType && item.acount > 0) {
					$(".bage-rkd").html(item.acount);
					$(".bage-rkd").css("display", "block");
				} else if(abp.sourceType.SELL_OUTPUT == item.aduitType && item.acount > 0) {
					$(".bage-xsck").html(item.acount);
					$(".bage-xsck").css("display", "block");
				} else if(abp.sourceType.WH_ALLOCATE == item.aduitType && item.acount > 0) {
					$(".bage-kcdb").html(item.acount);
					$(".bage-kcdb").css("display", "block");
				} else if(abp.sourceType.WH_CHECK == item.aduitType && item.acount > 0) {
					$(".bage-kcpd").html(item.acount);
					$(".bage-kcpd").css("display", "block");
				} else if(abp.sourceType.WH_INPUT == item.aduitType && item.acount > 0) {
					$(".bage-kcrk").html(item.acount);
					$(".bage-kcrk").css("display", "block");
				} else if(abp.sourceType.WH_OUTPUT == item.aduitType && item.acount > 0) {
					$(".bage-kcck").html(item.acount);
					$(".bage-kcck").css("display", "block");
				}
			});
		});
	};
	bageoption();
	mui("body").on("tap", ".pop-tab-conitem li", function() {
		chioceTab.muiSure();
		startDate = $(this).attr('data-statedate');
		endDate = $(this).attr('data-endDate');
		bageoption();

	});
	mui("body").on("tap", ".mui-grid-9 li", function() {
		var sdata = $(this).attr('data-sourcetype');
		sessionStorage.setItem('sourcetype', sdata);
		sessionStorage.setItem('startDate', startDate);
		sessionStorage.setItem('endDate', endDate);
	});

});